﻿using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

/// <summary>
/// Descripción breve de Utileria
/// </summary>
public class Utileria
{
	public Utileria()
	{
		//
		// TODO: Agregar aquí la lógica del constructor
		//
	}
    public String codif_cadena(String cadena)
    {
        String cad2 = "";
        Char[] cad = cadena.ToCharArray();
        for (int i = 0; i < cad.Length; i++)
        {
            cad[i] = (Char)((int)cad[i] + 26);

        }
        for (int a = 0; a < cad.Length; a++) cad2 = cad2 + cad[a].ToString();
        return cad2;

    }
    public String decodif_cadena(String cadena)
    {
        String cad2 = "";
        Char[] cad = cadena.ToCharArray();
        for (int i = 0; i < cad.Length; i++)
        {
            cad[i] = (Char)((int)cad[i] - 26);

        }
        for (int a = 0; a < cad.Length; a++) cad2 = cad2 + cad[a].ToString();
        return cad2;

    }
    public String conexion_app()
    {
        System.Configuration.Configuration rootWebConfig = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("/Pruebas");
        System.Configuration.ConnectionStringSettings strconexion = new ConnectionStringSettings();
        if (0 < rootWebConfig.ConnectionStrings.ConnectionStrings.Count)
        {
            strconexion = rootWebConfig.ConnectionStrings.ConnectionStrings["PruebasConnectionString"];

        }
        return strconexion.ConnectionString;

    }
}
